package com.beauty.dressing.module.main.holder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.beauty.dressing.R;
import com.beauty.dressing.common.base.BaseRecyclerViewHolder;
import com.beauty.dressing.common.bean.BaseBean;
import com.beauty.dressing.common.utils.ResUtil;
import com.facebook.drawee.view.SimpleDraweeView;
import com.framework.common.utils.IDisplayUtil;

/**
 * @author xutingz
 * @E-mail xutz@xianlanba.com
 * @date 2018/05/03
 */

public class VideoInListHolder extends BaseRecyclerViewHolder<BaseBean> {

    private ImageView mIcon;
    private TextView mTypeTxt,mDescTxt;
    private View mRootLayout;

    public VideoInListHolder(Context context, LayoutInflater inflater, ViewGroup viewGroup) {
        super(R.layout.video_in_list_item, context, inflater, viewGroup);
    }

    @Override
    public void findView() {
        mIcon = itemView.findViewById(R.id.icon_img);
        mTypeTxt = itemView.findViewById(R.id.type_txt);
        mDescTxt = itemView.findViewById(R.id.desc_txt);
        mRootLayout = itemView.findViewById(R.id.root_layout);
    }

    @Override
    public void bindData(BaseBean bean, int position) {
        registerItemClick(bean,position);
        if (position == 1){
            mTypeTxt.setTextColor(ResUtil.getColor(R.color.color_333333));
            mDescTxt.setTextColor(ResUtil.getColor(R.color.color_333333));
        }
    }

    public void bindForHeader(BaseBean baseBean){
        mRootLayout.setBackgroundColor(ResUtil.getColor(R.color.content_bg));
        int size = IDisplayUtil.dip2px(mContext,30);
        mIcon.getLayoutParams().width = size;
        mIcon.getLayoutParams().height = size;
        mTypeTxt.setVisibility(View.GONE);
        mDescTxt.setText("光影全脸定妆全科班[共2节课]");
    }


    @Override
    public void onItemClick(BaseBean bean, int position) {

    }
}
